package com.wantdo.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Date;
import java.util.Map;

/**
 * Created by king on 2017/10/13.
 */
@Controller
public class JspControl {

	// 从 application.properties 中读取配置，如取不到默认值为HelloShanhy
	@Value("${application.hello:Hello Angel}")
	private String hello;

	@GetMapping("/hello")
	public String welcome(Map<String, Object> model) {
		model.put("time", new Date());
		model.put("message", "afdsgadkgf");
		System.out.println("hello page");
		return "hello";
	}

}
